<!--
*Author：jxx
 *Contact：283591387@qq.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/finance/djlc/cw_djlc_wljgwh_view.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/finance/djlc/cw_djlc_wljgwh_view.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'cw_djlc_wlzb_id',
                footer: "Foots",
                cnName: '采购物料价格维护视图主表',
                name: 'djlc/cw_djlc_wljgwh_view',
                url: "/cw_djlc_wljgwh_view/",
                sortName: "CreateDate"
            });
            const editFormFields = ref({});
            const editFormOptions = ref([]);
            const searchFormFields = ref({"bomnumber":"","materialnum":"","parent_componentnum":"","componentnum":"","MTyp":"","description":"","unitprice":[null,null]});
            const searchFormOptions = ref([[{"title":"BOM编号","field":"bomnumber"},{"title":"整车头物料号","field":"materialnum","type":"like"},{"title":"组件号","field":"componentnum","type":"like"},{"title":"对象描述","field":"description","type":"like"}],[{"title":"单价","field":"unitprice","type":"range"},{"dataKey":"定价流程_MTyp","data":[],"title":"MTyp","field":"MTyp","type":"select"},{"title":"父物料号","field":"parent_componentnum","type":"like"}]]);
            const columns = ref([{field:'bomnumber',title:'BOM编号',type:'string',width:150,align:'left',sort:true},
                       {field:'materialnum',title:'整车头物料号',type:'string',width:180,align:'left'},
                       {field:'componentnum',title:'组件号',type:'string',width:180,align:'left'},
                       {field:'parent_componentnum',title:'父物料号',type:'string',width:220,align:'left'},
                       {field:'MTyp',title:'MTyp',type:'string',bind:{ key:'定价流程_MTyp',data:[]},width:60,align:'left'},
                       {field:'description',title:'对象描述',type:'string',width:300,align:'left'},
                       {field:'num',title:'数量',type:'decimal',width:50,align:'left'},
                       {field:'pricesource',title:'价格来源',type:'string',width:75,align:'left'},
                       {field:'unitprice',title:'单价',type:'decimal',width:100,align:'left'},
                       {field:'finalprice',title:'价格异议',type:'decimal',width:100,align:'left'},
                       {field:'pricereason',title:'调价原因',type:'string',width:220,align:'left'},
                       {field:'codename',title:'供应商代码',type:'string',width:100,align:'left'},
                       {field:'totalprice',title:'总价',type:'decimal',width:100,align:'left'},
                       {field:'effectivedatestart',title:'采购价格开始',type:'datetime',width:120,align:'left',sort:true},
                       {field:'effectivedateend',title:'采购价格结束',type:'datetime',width:120,align:'left',sort:true},
                       {field:'decrease',title:'降幅',type:'decimal',width:100,align:'left'},
                       {field:'rabate',title:'返利',type:'decimal',width:100,align:'left'},
                       {field:'rebateconditions',title:'返利条件',type:'string',width:120,align:'left'},
                       {field:'decreaseprice',title:'降幅金额',type:'decimal',width:100,align:'left'},
                       {field:'rabateprice',title:'返利金额',type:'decimal',width:100,align:'left'},
                       {field:'CreateDate',title:'创建日期',type:'datetime',width:120,hidden:true,align:'left',sort:true},
                       {field:'cw_djlc_wlzb_id',title:'物料主表UUID',type:'guid',width:110,hidden:true,require:true,align:'left'},
                       {field:'cw_djlc_jgwh_id',title:'价格维护UUID',type:'guid',width:110,hidden:true,align:'left'},
                       {field:'status',title:'状态',type:'int',width:80,hidden:true,align:'left'},
                       {field:'priceeffectivedatestart',title:'BOM价格开始',type:'datetime',width:120,hidden:true,align:'left',sort:true},
                       {field:'priceeffectivedateend',title:'BOM价格结束',type:'datetime',width:120,hidden:true,align:'left',sort:true},
                       {field:'cw_djlc_djzb_id',title:'流程主表UUID',type:'guid',width:110,hidden:true,align:'left'},
                       {field:'newunitprice',title:'新的价格',type:'decimal',width:110,hidden:true,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
